home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_315 / surf / control.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  104 lines

  1. #include "bezpt.h"
  2. #include "control.h"
  3. #include "scrnio.h"
  4. #include "mytypes.h"
  5.  
  6. CURMODE CurMode  = DRAWPOLY;
  7.  
  8.  
  9. void SetFitBez()
  10. {
  11.     if( GetNumSegs() < 1 )  {
  12.         return;
  13.     }
  14.     ClrWindow(true);
  15.     CurMode = FITBEZIER;
  16.     XdrawAllBezSegs();
  17. }
  18.  
  19.  
  20.  
  21.  
  22. void SetPolyDraw()
  23. {
  24.     ClrWindow(true);
  25.     CurMode = DRAWPOLY;
  26.     ClearSegments();
  27. }
  28.  
  29. /* one of Leonaards Additions */
  30.  
  31. void EditStartPt(x,y)
  32.     int x, y;
  33. {
  34.     DrawStartPt();
  35.     XdrawBezSeg();
  36.  
  37.     if( PrevSegNo() != GetNumSegs() ) {
  38.         PrevSeg();
  39.         XdrawBezSeg();
  40.         NextSeg();
  41.     }
  42.  
  43.     StartPtX( GetCurSeg()) = x;
  44.     StartPtY( GetCurSeg()) = y;
  45.  
  46.     if( PrevSegNo() != GetNumSegs() ) {
  47.         PrevSeg();
  48.         XdrawBezSeg();
  49.         NextSeg();
  50.     }
  51.  
  52.     XdrawBezSeg();
  53.     DrawStartPt();
  54. }
  55.  
  56. void EditEndPt(x,y)
  57.     int x, y;
  58. {
  59.     DrawEndPt();
  60.     XdrawBezSeg();
  61.  
  62.     if( NextSegNo() != GetFirstSeg() ) {
  63.         NextSeg();
  64.         XdrawBezSeg();
  65.         PrevSeg();
  66.     }
  67.  
  68.     EndPtX( GetCurSeg()) = x;
  69.     EndPtY( GetCurSeg()) = y;
  70.  
  71.     if( NextSegNo() != GetFirstSeg() ) {
  72.         NextSeg();
  73.         XdrawBezSeg();
  74.         PrevSeg();
  75.     }
  76.  
  77.     XdrawBezSeg();
  78.     DrawEndPt();
  79. }
  80.  
  81.  
  82.  
  83. void EditControl0(x,y)
  84.     int x, y;
  85. {
  86.         DrawControl0();
  87.         XdrawBezSeg();
  88.         Cntrl1X(GetCurSeg()) = x;
  89.         Cntrl1Y(GetCurSeg()) = y;
  90.         XdrawBezSeg();
  91.         DrawControl0();
  92. }
  93.  
  94. void EditControl1(x,y)
  95. int x, y;
  96. {
  97.         DrawControl1();
  98.         XdrawBezSeg();
  99.         Cntrl2X(GetCurSeg()) = x;
  100.         Cntrl2Y(GetCurSeg()) = y;
  101.         XdrawBezSeg();
  102.         DrawControl1();
  103. }
  104.